Leadtools.ImageProcessing.Color Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
RemapIntensityCommand Constructor(RemapIntensityCommandFlags,Int32[])
See Also  Example



flags
Determines the color channel that will be used. For more information, refer to RasterColorChannel.
lookupTable
Table of integers containing lookup values.
Initializes a new RemapIntensityCommand class object with explicit parameters.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal flags As RemapIntensityCommandFlags, _
   ByVal lookupTable() As Integer _
)
Visual Basic (Usage)Copy Code
Dim flags As RemapIntensityCommandFlags
Dim lookupTable() As Integer
 
Dim instance As RemapIntensityCommand(flags, lookupTable)
C# 
public RemapIntensityCommand( 
   RemapIntensityCommandFlags flags,
   int[] lookupTable
)
C++/CLI 
public:
RemapIntensityCommand( 
   RemapIntensityCommandFlags flags,
   array<int>^ lookupTable
)

Parameters

flags
Determines the color channel that will be used. For more information, refer to RasterColorChannel.
lookupTable
Table of integers containing lookup values.

Example

Run the RemapIntensityCommand on an image.

Visual BasicCopy Code
Public Sub RemapIntensityConstructorExample()
   RasterCodecs.Startup()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")

   ' Prepare the command
   'This example will darken loaded image by using lookup table affected by exponential function.
   Dim LookupTable() As Integer ' Array to hold lookup table.
   ReDim LookupTable(255)
   'Get Lookup table where the array calculated by the linear function for all the items of the array is from 0 - 255.
   LookupTable(0) = 255
   LookupTable(255) = 0
   EffectsUtilities.GetFunctionalLookupTable(LookupTable, 0, 255, 5, FunctionalLookupTableFlags.Linear)

   Dim command As RemapIntensityCommand = New RemapIntensityCommand(RemapIntensityCommandFlags.Master, LookupTable)
   command.Run(leadImage)
   codecs.Save(leadImage, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24)

   RasterCodecs.Shutdown()
End Sub
C#Copy Code
public void RemapIntensityConstructorExample() 

   // Load an image 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg"); 
 
   // Prepare the command 
   //This example will darken loaded image by using lookup table affected by exponential function. 
   int[] LookupTable = new int[256]; // Array to hold lookup table. 
   //Get Lookup table where the array calculated by the linear function for all the items of the array is from 0 - 255. 
   LookupTable[0] = 255; 
   LookupTable[255] = 0; 
 
   EffectsUtilities.GetFunctionalLookupTable(LookupTable, 0, 255, 5, FunctionalLookupTableFlags.Linear); 
   RemapIntensityCommand command = new RemapIntensityCommand(RemapIntensityCommandFlags.Master, LookupTable); 
   command.Run(image); 
   codecs.Save(image, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24); 
 
   RasterCodecs.Shutdown(); 
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also